package me.zhengjie.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 楼层最大最小起订量
 * @TableName iws_floor_min_max
 */
@TableName(value ="iws_floor_min_max")
@Data
public class FloorMinMaxDao implements Serializable {
    /**
     * 楼层
     */
    @TableId(type = IdType.AUTO)
    private String floorId;

    /**
     * 最小起订量
     */
    @TableField(value = "min_weight")
    private Double minWeight;

    /**
     * 最大起订量
     */
    @TableField(value = "max_weight")
    private Double maxWeight;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FloorMinMaxDao other = (FloorMinMaxDao) that;
        return (this.getFloorId() == null ? other.getFloorId() == null : this.getFloorId().equals(other.getFloorId()))
            && (this.getMinWeight() == null ? other.getMinWeight() == null : this.getMinWeight().equals(other.getMinWeight()))
            && (this.getMaxWeight() == null ? other.getMaxWeight() == null : this.getMaxWeight().equals(other.getMaxWeight()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFloorId() == null) ? 0 : getFloorId().hashCode());
        result = prime * result + ((getMinWeight() == null) ? 0 : getMinWeight().hashCode());
        result = prime * result + ((getMaxWeight() == null) ? 0 : getMaxWeight().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", floorId=").append(floorId);
        sb.append(", minWeight=").append(minWeight);
        sb.append(", maxWeight=").append(maxWeight);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}